Optimal. Leaf size=60 \[ a (2 b B+a C) x+\frac {b (b B+2 a C) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 B \sin (c+d x)}{d}+\frac {b^2 C \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {4157, 4109,
3855, 3852, 8} \begin {gather*} \frac {a^2 B \sin (c+d x)}{d}+\frac {b (2 a C+b B) \tanh ^{-1}(\sin (c+d x))}{d}+a x (a C+2 b B)+\frac {b^2 C \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 4109
Rule 4157
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \cos (c+d x) (a+b \sec (c+d x))^2 (B+C \sec (c+d x)) \, dx\\ &=\frac {a^2 B \sin (c+d x)}{d}-\int \left (-a (2 b B+a C)+\left (-b^2 B-2 a b C\right ) \sec (c+d x)-b^2 C \sec ^2(c+d x)\right ) \, dx\\ &=a (2 b B+a C) x+\frac {a^2 B \sin (c+d x)}{d}+\left (b^2 C\right ) \int \sec ^2(c+d x) \, dx+(b (b B+2 a C)) \int \sec (c+d x) \, dx\\ &=a (2 b B+a C) x+\frac {b (b B+2 a C) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 B \sin (c+d x)}{d}-\frac {\left (b^2 C\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}\\ &=a (2 b B+a C) x+\frac {b (b B+2 a C) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 B \sin (c+d x)}{d}+\frac {b^2 C \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.53, size = 109, normalized size = 1.82 \begin {gather*} \frac {a (2 b B+a C) (c+d x)-b (b B+2 a C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+b (b B+2 a C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+a^2 B \sin (c+d x)+b^2 C \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 86, normalized size = 1.43
method | result | size |
derivativedivides | \(\frac {b^{2} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+b^{2} C \tan \left (d x +c \right )+2 a b B \left (d x +c \right )+2 a b C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} B \sin \left (d x +c \right )+a^{2} C \left (d x +c \right )}{d}\) | \(86\) |
default | \(\frac {b^{2} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+b^{2} C \tan \left (d x +c \right )+2 a b B \left (d x +c \right )+2 a b C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} B \sin \left (d x +c \right )+a^{2} C \left (d x +c \right )}{d}\) | \(86\) |
risch | \(2 B a b x +x \,a^{2} C -\frac {i a^{2} B \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{2} B \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {2 i b^{2} C}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2} B}{d}+\frac {2 b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2} B}{d}-\frac {2 b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}\) | \(160\) |
norman | \(\frac {\left (-2 a b B -a^{2} C \right ) x +\left (-4 a b B -2 a^{2} C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-2 a b B -a^{2} C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 a b B +a^{2} C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 a b B +a^{2} C \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (4 a b B +2 a^{2} C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {2 \left (a^{2} B -b^{2} C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 \left (a^{2} B +b^{2} C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {4 a^{2} B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a^{2} B \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 b^{2} C \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}+\frac {b \left (b B +2 a C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {b \left (b B +2 a C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(335\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 103, normalized size = 1.72 \begin {gather*} \frac {2 \, {\left (d x + c\right )} C a^{2} + 4 \, {\left (d x + c\right )} B a b + 2 \, C a b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + B b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, B a^{2} \sin \left (d x + c\right ) + 2 \, C b^{2} \tan \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.56, size = 117, normalized size = 1.95 \begin {gather*} \frac {2 \, {\left (C a^{2} + 2 \, B a b\right )} d x \cos \left (d x + c\right ) + {\left (2 \, C a b + B b^{2}\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, C a b + B b^{2}\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (B a^{2} \cos \left (d x + c\right ) + C b^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (B + C \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 154 vs.
\(2 (60) = 120\).
time = 0.51, size = 154, normalized size = 2.57 \begin {gather*} \frac {{\left (C a^{2} + 2 \, B a b\right )} {\left (d x + c\right )} + {\left (2 \, C a b + B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (2 \, C a b + B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.28, size = 163, normalized size = 2.72 \begin {gather*} \frac {C\,b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {2\,C\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {B\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{2\,d\,\cos \left (c+d\,x\right )}+\frac {4\,B\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,C\,a\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________